<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>兼容</title>
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <!--
    与IOS交互
  -->
</head>
<body>
<button id="clickme">点我</button>
<p id="show"></p>
<script>
  var vB = function (callback) {
    if (window.WebViewJavascriptBridge) {
      return callback(WebViewJavascriptBridge);
    }
    if (window.WVJBCallbacks) {
      return window.WVJBCallbacks.push(callback);
    }
    window.WVJBCallbacks = [callback];
    var WVJBIframe = document.createElement('iframe');
    WVJBIframe.style.display = 'none';
    WVJBIframe.src = 'https://__bridge_loaded__';
    document.documentElement.appendChild(WVJBIframe);
    setTimeout(function () {
      document.documentElement.removeChild(WVJBIframe)
    }, 0)
  };

  var btn = document.getElementById('clickme');
  var show = document.getElementById('show')

  btn.onclick = function () {
    show.innerHTML = '世界-的我们';
    vB(function (b) {
      b.callHandler("height", null, function(response) {
        alert('Screen height:' + response)
      })
    });
  };
</script>
</body>
</html>